<!DOCTYPE html>
<html>
<head>
    <title>选房情况汇总表</title>
<#include "../../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid" style="padding-bottom: 100px">
    <div class="layui-card">
        </div>
        <div class="layui-card-body">
            <button class="layui-btn layui-btn-bg" id="excelBtn"><i
                    class="layui-icon layui-icon-export"></i>导出Excel
            </button>
            <table class="layui-table table" style="text-align: center;">
                <tr class="layui-bg-gray">
                    <th style="text-align: center;" rowspan="3">序号</th>
                    <th style="text-align: center;" colspan="3">基础信息</th>
                    <th style="text-align: center;" colspan="17">选房情况</th>
                </tr>
                <tr class="layui-bg-gray">
                    <th style="text-align: center;" rowspan="2" >年份</th>
                    <th style="text-align: center;" colspan="3">征迁安置情况</th>
                    <th style="text-align: center;" colspan="2">小户型</th>
                    <th style="text-align: center;" colspan="10">普通型</th>
                    <th style="text-align: center;" colspan="2">房源合计</th>
                    <th style="text-align: center;" colspan="2">储物间</th>
                    <th style="text-align: center;" rowspan="2">车位数</th>
                </tr>
                <tr class="layui-bg-gray">
                    <th style="text-align: center;">安置区</th>
                    <th style="text-align: center;">项目数</th>
                    <th style="text-align: center;">户数</th>
                    <th style="text-align: center;">一室(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                    <th style="text-align: center;">一室二厅(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                    <th style="text-align: center;">二室二厅(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                    <th style="text-align: center;">三室二厅(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                    <th style="text-align: center;">四室二厅(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                    <th style="text-align: center;">数量(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                    <th style="text-align: center;">数量(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                    <th style="text-align: center;">数量(套)</th>
                    <th style="text-align: center;">面积(㎡)</th>
                </tr>
            <#assign index = 0/>
            <#assign allContractCountSum = 0/>
            <#assign allZsProjectCountSum = 0/>
            <#assign allMoreCountSum = 0/>
            <#assign allMoreMoneySum = 0/>
            <#assign allLessCountSum = 0/>
            <#assign allLessMoneySum = 0/>
            <#assign allFinalMoneySum = 0/>
            <#assign allSmallHouseCountSum = 0/>
            <#assign allSmallHouseAreaSum = 0/>
            <#assign all0100HouseCountSum = 0/>
            <#assign all0100HouseAreaSum = 0/>
            <#assign all0102HouseCountSum = 0/>
            <#assign all0102HouseAreaSum = 0/>
            <#assign all0202HouseCountSum = 0/>
            <#assign all0202HouseAreaSum = 0/>
            <#assign all0302HouseCountSum = 0/>
            <#assign all0302HouseAreaSum = 0/>
            <#assign all0402HouseCountSum = 0/>
            <#assign all0402HouseAreaSum = 0/>
            <#assign allNormalHouseCountSum = 0/>
            <#assign allNormalHouseAreaSum = 0/>
            <#assign allHouseCountSum = 0/>
            <#assign allHouseAreaSum = 0/>

            <#assign allStorageRoomCountSum = 0/>
            <#assign allStorageRoomAreaSum = 0/>
            <#assign allCarLotCountSum = 0/>
            <#if yearList?size !=0>
                <#list yearList as year>
                    <#assign yearMap = (resultMap[year])! />
                    <#assign storageRoomYearMap = (storageRoomMap[year])! />
                    <#assign carLotYearMap = (carLotMap[year])! />

                    <#list yearMap?keys as key>
                        <#assign yearTownMap = (yearMap[key])/>
                        <#assign allZsProjectCountSum = allZsProjectCountSum + yearTownMap['zspCount']/>
                        <#assign allContractCountSum = allContractCountSum + yearTownMap['contractCount']/>
                        <#assign allSmallHouseCountSum = allSmallHouseCountSum + yearTownMap['smallHouseNum']/>
                        <#assign allSmallHouseAreaSum = allSmallHouseAreaSum + yearTownMap['smallHouseArea']/>
                        <#assign all0102HouseCountSum = all0102HouseCountSum + yearTownMap['0102HouseNum']/>
                        <#assign all0102HouseAreaSum = all0102HouseAreaSum + yearTownMap['0102HouseArea']/>
                        <#assign all0202HouseCountSum = all0202HouseCountSum + yearTownMap['0202HouseNum']/>
                        <#assign all0202HouseAreaSum = all0202HouseAreaSum + yearTownMap['0202HouseArea']/>
                        <#assign all0302HouseCountSum = all0302HouseCountSum + yearTownMap['0302HouseNum']/>
                        <#assign all0302HouseAreaSum = all0302HouseAreaSum+ yearTownMap['0302HouseArea']/>
                        <#assign all0402HouseCountSum = all0402HouseCountSum + yearTownMap['0402HouseNum']/>
                        <#assign all0402HouseAreaSum = all0402HouseAreaSum + yearTownMap['0402HouseArea']/>
                        <#assign allNormalHouseCountSum = allNormalHouseCountSum + yearTownMap['normalHouseNum']/>
                        <#assign allNormalHouseAreaSum = allNormalHouseAreaSum + yearTownMap['normalHouseArea']/>
                        <#assign allHouseCountSum = allHouseCountSum + yearTownMap['houseNum']/>
                        <#assign allHouseAreaSum = allHouseAreaSum + yearTownMap['houseArea']/>
                        <#assign allStorageRoomCountSum = allStorageRoomCountSum + (storageRoomYearMap[key]['storageRoomNum'])!0/>
                        <#assign allStorageRoomAreaSum = allStorageRoomAreaSum + (storageRoomYearMap[key]['storageRoomArea'])!0/>
                        <#assign allCarLotCountSum = allCarLotCountSum + (carLotYearMap[key]['carLotNum'])!0/>
                        <tr>
                            <#assign index = index+1 />
                            <td>${index}</td>
                            <td>${year}年</td>
                            <td>${yearTownMap['azProjectName']}</td>
                            <td>${yearTownMap['zspCount']}</td>
                            <td>${yearTownMap['contractCount']}</td>
                            <td>${yearTownMap['smallHouseNum']}</td>
                            <td>${yearTownMap['smallHouseArea']}</td>
                            <td>${yearTownMap['0102HouseNum']}</td>
                            <td>${yearTownMap['0102HouseArea']}</td>
                            <td>${yearTownMap['0202HouseNum']}</td>
                            <td>${yearTownMap['0202HouseArea']}</td>
                            <td>${yearTownMap['0302HouseNum']}</td>
                            <td>${yearTownMap['0302HouseArea']}</td>
                            <td>${yearTownMap['0402HouseNum']}</td>
                            <td>${yearTownMap['0402HouseArea']}</td>
                            <td>${yearTownMap['normalHouseNum']}</td>
                            <td>${yearTownMap['normalHouseArea']}</td>
                            <td>${yearTownMap['houseNum']}</td>
                            <td>${yearTownMap['houseArea']}</td>
                            <td>${(storageRoomYearMap[key]['storageRoomNum'])!0}</td>
                            <td>${(storageRoomYearMap[key]['storageRoomArea'])!0}</td>
                            <td>${(carLotYearMap[key]['carLotNum'])!0}</td>
                        </tr>

                    </#list>
                </#list>
            </#if>
                <tr bgcolor="#b0c4de">
                    <td colspan="3">合计</td>
                    <td><a href="../statistics/contractShow.ftl?azProjectId=${(azProject.id)!}">${allContractCountSum}</td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseType=0100">${allSmallHouseCountSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseType=0100">${allSmallHouseAreaSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0102">${all0102HouseCountSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0102">${all0102HouseAreaSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0202">${all0202HouseCountSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0202">${all0202HouseAreaSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0302">${all0302HouseCountSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0302">${all0302HouseAreaSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0402">${all0402HouseCountSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0402">${all0402HouseAreaSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseType=01">${allNormalHouseCountSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}&houseType=01">${allNormalHouseAreaSum}
                    </td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}">${allHouseCountSum}</td>
                    <td><a href="../statistics/houseShow.ftl?azProjectId=${(azProject.id)!}">${allHouseAreaSum}</td>
                    <td>${allStorageRoomCountSum}</td>
                    <td>${allStorageRoomAreaSum}</td>
                    <td>${allCarLotCountSum}</td>
                </tr>
            </table>
        </div>
    </div>
</div>
<div class="footer">
    <button type="button" class="layui-btn layui-btn-green" id="backBtn">返　回</button>
</div>
</body>
</html>
<script src="/layui/layui.js" charset="utf-8"></script>
<script src="/plugins/jquery/jquery.min.js" charset="utf-8"></script>
<script src="/plugins/tableExcel/jquery.table2excel.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['jquery'], function () {
        var $ = layui.jquery;

        $("#backBtn").click(function () {
            javascript:history.back(-1);
        });
    });
    $("#excelBtn").click(function () {
        $(".table").table2excel({
            exclude: ".noExl",
            name: "${(azProject.projectName)!}选房情况年度汇总表",
            filename: "${(azProject.projectName)!}选房情况年度汇总表",
            exclude_img: true,
            exclude_links: true,
            exclude_inputs: true
        });
    });
</script>